<?php
namespace app\admin\model;
use think\Db;
use think\Model;

class User extends Model
{
  //====================
  //1.获取今日登录用户数 
  //====================
  
  /**
   * [1-1 获取今日登录用户数]
   */
  static function getDairyLoginUsers(){
    $time = date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d"),date("y")));
    $data = array('last_login_time'=>array("gt",$time));
    $Login_Users = Db::name("User")->where($data)->count();
    return $Login_Users;
  }
}  
?>